<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var arr=[1,2,3]
    var sum=0
    arr.forEach(function (value,index,array) {
        console.log('每一个数组元素'+value)
        console.log('每一个数组索引'+index)
        console.log('数组本身'+array)
        sum+=value
    })
    console.log(sum)
</script>
</body>
</html>